package com.wm.wmim.connect.ws.rpcinvoke;

import com.wm.wmim.common.dto.RpcRespDTO;
import com.wm.wmim.common.utils.RpcRespUtils;
import com.wm.wmim.connect.center.api.bo.req.RouteDeleteReqBO;
import com.wm.wmim.connect.center.api.bo.req.RouteGetReqBO;
import com.wm.wmim.connect.center.api.bo.req.RouteSaveReqBO;
import com.wm.wmim.connect.center.api.bo.resp.RouteGetRespBO;
import com.wm.wmim.connect.center.api.rpc.RouteRpcService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

/**
 * @author weiming
 * @date 2024/12/17 23:23
 * @description
 */
@Service
public class RouteInfoRpcInvokeService {

    @DubboReference(version = "1.0.0", check = false)
    private RouteRpcService routeRpcService;

    public void saveRouteInfo(RouteSaveReqBO reqBO){
        RpcRespUtils.getData(routeRpcService.saveRouteInfo(reqBO));
    }

    public void deleteRouteInfo(RouteDeleteReqBO reqBO){
        RpcRespUtils.getData(routeRpcService.deleteRouteInfo(reqBO));
    }

    public RouteGetRespBO getRouteInfo(RouteGetReqBO reqBO){
        RpcRespDTO<RouteGetRespBO> routeInfo = routeRpcService.getRouteInfo(reqBO);
        RouteGetRespBO data = RpcRespUtils.getData(routeInfo);
        return data;
    }

}
